﻿using System;

class GCDOfTwoNumbers
{
    static void Main()
    {
        Console.WriteLine("Enter the first positive number:");
        int FirstNumber = int.Parse(Console.ReadLine());
        Console.WriteLine("Enter the second positive number:");
        int SecondNumber = int.Parse(Console.ReadLine());
        if (FirstNumber <= 0 || SecondNumber <= 0)
        {
            Console.WriteLine("Invalid input!");
        }
        else if (FirstNumber > SecondNumber)
        {
            while (FirstNumber - SecondNumber > 0)
            {
                FirstNumber = FirstNumber - SecondNumber;
            }
            Console.WriteLine("The GCD of the two numbers is {0}", FirstNumber);
        }
        else if (FirstNumber < SecondNumber)
        {
            while (SecondNumber - FirstNumber > 0)
            {
                SecondNumber = SecondNumber - FirstNumber;
            }
            Console.WriteLine("The GCD of the two numbers is {0}", SecondNumber);
        }
        else
            Console.WriteLine("The GCD of the two numbers is {0}", FirstNumber);
    }
}

